package main;

import simplestatemachine.SimplestatemachineFactory;
import simplestatemachine.State;
import simplestatemachine.Transition;
import simplestatemachine.TransitionTrigger;

/**
 * In this state machine we only have three things:
 * 
 * <ol>
 * <li>States, conceptually these can model states in an activity as well as
 * activities.</li>
 * 
 * <li>Transitions, these model transitions between states.</li>
 * 
 * <li>TransitionTriggers, these pertain to a given Transition and tell us which
 * input will cause us to fire the transition</li>
 * </ol>
 * 
 * Note that we have no special concepts for StateTransition, ActivityTransition (these are just modeled as a Transition), 
 * Event and Result (these are just TransitionTriggers) and Activity (this is just a State).
 * 
 * The main benefit of this model is:
 * <ol>
 * <li>Simplicity, we don't need to for instance model an Activity (Aktivitet) any other way than a State (Tilstand)</li>
 * <li>The developer does not need to know about the concepts from Mood - it is just a state machine</li>
 * </ol>
 * 
 * The main drawback of this model is:
 * <ol>
 * <li>When working with the model the developer need to be very sharp as the is no type safe way of telling a State (Tilstand) apart from an Activity (Aktivitet)</li>
 * </ol>

 * 
 * @author Kim, Sanna
 * 
 */
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		State stateA = SimplestatemachineFactory.eINSTANCE.createState();
		State stateB = SimplestatemachineFactory.eINSTANCE.createState();

		TransitionTrigger trigger = SimplestatemachineFactory.eINSTANCE
				.createTransitionTrigger();
		trigger.setTrigger("Start");

		Transition transition = SimplestatemachineFactory.eINSTANCE
				.createTransition();
		transition.setTrigger(trigger);
		transition.setResultingState(stateB);

		stateA.getTransitions().add(transition);

		State stateC = SimplestatemachineFactory.eINSTANCE.createState();

		TransitionTrigger toState = SimplestatemachineFactory.eINSTANCE
				.createTransitionTrigger();
		trigger.setTrigger("Resultat");

		Transition transitionToState = SimplestatemachineFactory.eINSTANCE
				.createTransition();
		transitionToState.setTrigger(toState);
		transitionToState.setResultingState(stateC);

		stateB.getTransitions().add(transitionToState);

	}

}
